package com.yootk.main;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.ClassUtils;

import java.util.Locale;

public class MessageResourceDemo {
    private static final Logger LOGGER = LoggerFactory.getLogger(SpringAnnotationProfile.class);
    public static void main(String[] args) throws Exception { // 该抛就抛
        ResourceBundleMessageSource source = new ResourceBundleMessageSource() ;
        source.setBasenames("i18n.Message");
        LOGGER.info("Message默认资源：{}",source.getMessage("yookt.site",null,null));
        LOGGER.info("Message中文资源：{}",source.getMessage("yookt.site",null,new Locale("zh","CN")));
        LOGGER.info("Message英文资源：{}",source.getMessage("yookt.site",null,new Locale("en","US")));
    }
}